package com.lyf.exception;

import com.lyf.comon.ResponseResult;
import com.lyf.constant.CommonConstants;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler extends Throwable {
    @ExceptionHandler(Exception.class)
    public ResponseResult handleException(Exception e) {
        e.printStackTrace();
        return new ResponseResult(CommonConstants.FAIL,"异常：" + e.getMessage());
    }
}
